home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / batutil1.zip / MENUDEMO.BAT < prev    next >
DOS Batch File  |  1990-03-25  |  4KB  |  122 lines

  1. :Batutil c(o) 1990 Barry Simon and Richard Wilson
  2. : Version 1.0
  3. echo off
  4. cls
  5. if x%1 == xok goto restart1
  6. batutil [@E]
  7. if errorlevel 40 goto restart
  8. cls
  9. echo Sorry; this batch file requires more than 40 bytes of free environment
  10. echo   space.  You have less; if you have DOS 3.2 or 3.3. use command
  11. echo   with the /E: parameter.
  12. batutil [GE WA8 ELSE]
  13. goto wayend
  14. :echo1
  15. @0AWelcome to the demonstration of @8EBATUTIL@0A's menu making
  16. @0A  You can make all sorts of menus and get the user's choice returned
  17.   in the errorlevel and also in the environment.  In a moment we'll
  18.   show you a typical menu.  For every menu we show you'll have to
  19.   make a choice although the choice won't have any effect in this
  20.   demo.  After the first we'll show you the choice made and the command to
  21.   make the menu.  At any menu hitting $lEsc$g will exit the batch file.
  22. Now please hit a key to continue.
  23. :echo2
  24. this is a choice in the menu: #1
  25. this is a choice in the menu: #2
  26. this is a choice in the menu: #3
  27. this is a choice in the menu: #4
  28. this is a choice in the menu: #5
  29.     @ This separates menu items from help text; the rest of the line is ignored
  30. You can also display a line of text for each menu item if you wish
  31. That way you can give up to 80 characters of extra explanation of menu items
  32. These lines will be centered and they can be very
  33. short
  34. or very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
  35. Notice that extra help lines beyond the number of menu items get ignored
  36. :echo3
  37. You picked choice $x(RC)
  38.   That menu was made with the command
  39.  
  40. @1FBatutil {AT=00}{CL}{MH This is a wide menu}{FM %0 echo2}
  41.  
  42. @1Ewhich uses the FMenu command to read in a menu from a file; in this
  43. case from this batch file itself!  The help text is in the same file
  44.  
  45.     Do you wish to see that menu again(Y/N)?
  46. :echo4
  47. You picked choice $x(RC)
  48.   That menu was made with the command:
  49.  
  50. @1FBatutil $(AT 30$)$(MN 70$)$(SH$)$(MH This is a menu header$)$(ME ....$)
  51.  
  52. @1E   Do you wish to see that menu again(Y/N)?
  53. :echo5
  54. You picked choice $x(RC)
  55.   That menu was made with the command:
  56.  
  57. @1FBatutil {PO}{FK}{ME This$$Smenu$$Shas$$Sfunction key$$Schoices$$Salso}
  58.  
  59. @1EIf one uses {PO +} instead of {PO} there are also sound effects
  60.  
  61.     What is your name, please
  62.  
  63. :echo6
  64. You picked choice #$x(RC)
  65. That menu was made with the command:
  66. @1F    Batutil $(MEnu a b c d e f g h i j k l m n$)
  67.  
  68.   Do you wish to see that menu again(Y/N)?
  69. :restart1
  70. set a=
  71. set b=
  72. :restart
  73. set cur=off
  74. batutil {AT=0A}{CL}{RO 8}{FP %0 echo1}{AS}
  75. if %RC%==27 goto end
  76. :firstmenu
  77. batutil {AT=30}{CL}{AT=0}{MN=70}{SH}{PO +}{MH $W, $E $H:$m}{ME Here$Sis$Sa$Smenu$Swith many$Sfancy$Sfeatures$Senabled}
  78. if not errorlevel 1 goto end
  79. batutil {AT=30}{EC $_$_$_$_You picked choice #%RC%$_  Do you wish to see that menu again (Y/N)?}{CU +}[GE N CR Y]
  80. if errorlevel 3 goto firstmenu
  81. batutil {AT=3F}{EC $_$_}{CO=5}{EC Menus can be tall and thin}{GE WA2}
  82. :secondmenu
  83. batutil {AT=00}{CL}{ME a b c d e f g h i j k l m n}{AT=1E}{CL}{RO=5}{CO=1}
  84. if %RC%==0 goto end
  85. batutil {FP %0 echo6}{CU +}[GE N CR Y]
  86. if errorlevel 3 goto secondmenu
  87. batutil {AT=4E}{EC $_$_  Or menus can be short and fat}{GE WA2}
  88. :thirdmenu
  89. set fo=this is a choice in the menu: #
  90. batutil {AT=0E}{CL}{MH This is a wide menu}{FM %0 echo2}{AT=1E}{CL}{RO=5}{CO=1}
  91. if %RC%==0 goto end
  92. batutil {AT=1E}{FP %0 echo3}{CU +}[GE N CR Y]
  93. if errorlevel 3 goto thirdmenu
  94. batutil {AT=4E}{EC $_$_  Menus can have headers and/or a shadow}{GE WA3}
  95. :fourthmenu
  96. batutil {AT=00}{CL}
  97. batutil {AT 30}{MN 70}{SH}{MH This is a menu header}{ME you$Scan$SpIck a$ScHoice$Swith The$Shighlighted$Scapital$Sletter}
  98. if %RC%==0 goto end
  99. batutil {AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo4}{CU +}[GE CR N Y]
  100. if errorlevel 3 goto fourthmenu
  101. batutil {AT=4E}{EC $_$_  Menus can explode with or without sound effects}{GE WA3}
  102. :fifthmenu
  103. batutil {AT=00}{CL}{PO}{FK}{ME This$Smenu$Shas$Sfunction key$Schoices$Salso}
  104. if %RC%==0 goto end
  105. batutil {AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo5}{set name=$Q}
  106. batutil {CL}{MH $x(name)'s Menu}{me eXit Last$Smenu Restart}
  107. if errorlevel 3 goto restart
  108. if errorlevel 2 goto fifthmenu
  109. :end
  110. set fo=
  111. set rc=
  112. set cur=
  113. batutil {CL}{set cur=}{RO 5}{CO 5}{PR Thank @1Fyou @1Efor trying @1FBATUTIL!$_}
  114. goto waywayend
  115. :wayend
  116. cls
  117. echo   
  118. echo   
  119. echo   
  120. echo  Thank you for trying BATUTIL
  121. :waywayend 
  122.